# @Time:2023/4/27 10:44
# -*- coding: UTF-8 -*-
from rest_framework import serializers

from goods.models import Goods
from goods.serializers import GoodsSerializer
from order.models import OrderGoods, Comment, Order

# class GoodsReadSerializer(serializers.ModelSerializer):
#     class Meta:
#         model = Goods
#         fields = []

class OrderGoodsSerializer(serializers.ModelSerializer):
    """订单商品序列化器"""
    goods=GoodsSerializer()
    class Meta:
        model=OrderGoods
        fields=['goods','number','price']

class CommentSerializer(serializers.ModelSerializer):
    class Meta:
        model=Comment
        fields="__all__"

class OrderSerializer(serializers.ModelSerializer):
    class Meta:
        model=Order
        fields="__all__"